package com.Cychat.commons.entity.pojo;


import java.util.Date;

import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.IdType;
import org.springframework.format.annotation.DateTimeFormat;

@Data
@TableName("comment")
public class Comment {
    @Schema(description="评论ID")
    @TableId(value = "comment_id", type = IdType.AUTO)
    private Integer commentId;
    @Schema(description="所属帖子ID")
    private Integer postId;
    @Schema(description="评论者用户ID")
    private Long userId;
    @Schema(description="父评论ID，NULL表示一级评论")
    private Integer parentId;
    @Schema(description="根评论ID（用于快速查询整个评论树）")
    private Integer rootId;
    @Schema(description="评论内容")
    private String content;
    @Schema(description="评论层级（1为一级评论，2为回复，依此类推）")
    private Integer level;
    @Schema(description="点赞数")
    private Integer likeCount;
    @Schema(description="状态，0为删除，1为正常")
    private Integer status;
    @Schema(description="创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;
    @Schema(description="更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private Date updateTime;

    @TableField(exist = false)
    private String nickName;
    @TableField(exist = false)
    private String avatarUrl;
}